package com.tree.backend.controller;

import com.tree.backend.common.Result;
import com.tree.backend.entity.vo.MemberComposition;
import com.tree.backend.service.IPartyMemberService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 党员基本信息表，记录党员的个人信息和工作情况 前端控制器
 * </p>
 *
 * @author tree
 * @since 2025-10-15
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/party-member")
public class PartyMemberController {
    private final IPartyMemberService partyMemberService;

    @GetMapping("/composition")
    public Result<List<MemberComposition>> getComposition(){
        return Result.success(partyMemberService.getComposition());
    }
}
